<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="${pageContext.request.contextPath}/static/js/jquery-1.11.0.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/bootstrap.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap.min.css" media="all">

    <script>
        $(function (){
            var flag=true;
            $.get("admin/find",{},function (data){
                var msg="当前管理员："+data.username+"   ";
                $("#span_username").html(msg);
                $("#exit").html("退出");
                if (data==null){
                    flag=false;
                }
            });
            $("#exit").click(function () {
                location.href = "${pageContext.request.contextPath}/admin/exit";
            });
            let barid="${requestScope.barid}";
            $("#navMove>li").each(function (){
                if(barid==$(this).children().attr("id")){
                    $(this).addClass("active");
                }else {
                    $(this).removeClass();
                }
                    $(this).children().click(function () {
                    location.href="${pageContext.request.contextPath}/admin/"+$(this).attr("id");
                })
            });
        });
    </script>
</head>
<body>

        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#menu">
                    <span class="sr-only"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
            </div>
            <div class="collapse navbar-collapse" id="menu">
                <ul class="nav navbar-nav" id="navMove">
                    <li><a id="animationAdmin">动漫管理</a></li>
                    <li><a id="userAdmin">用户管理</a></li>
                    <li><a id="commentAdmin">评论管理</a></li>
                </ul>
                <div class="loginUser" style="float:right;">
                    <p></p>
                    <span id="span_username" style="color: #f7f7f7"></span>
                    <a id="exit" type="button">请登录</a>
                </div>
            </div>
        </nav>
</body>
</html>